<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:s="http://jboss.com/products/seam/taglib"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:a="https://ajax4jsf.dev.java.net/ajax"
	xmlns:rich="http://richfaces.org/rich"
	xmlns:j4j="http://javascript4jsf.dev.java.net/"
	template="../include/template.xhtml">

	<ui:define name="content">
			<style type="text/css">
<!--
.input1 {
	width:40%;
}
-->
</style>
		<br />
		<rich:spacer width="10px" />
		<h:outputText style="font-weight: bold;"
			value="完善以下资料，将有助于affectu为您提供更人性化的服务。"></h:outputText>
		<s:div style="float:right;">
			<h:form>
				<rich:fileUpload addControlLabel="添加头像"
					fileUploadListener="#{profileAction.uploadListener}"
					maxFilesQuantity="1" reRender="table" id="upload"
					immediateUpload="true" acceptedTypes="jpg, gif, png, bmp"
					listHeight="200" listWidth="200">
				</rich:fileUpload>
			</h:form>
		</s:div>
		<rich:panel>
			<h:form id="detailForm">
				<s:decorate template="../include/wike/validInputField.xhtml">
					<ui:define name="label">昵称</ui:define>
					<h:inputText value="#{profileAction.user.nickName}" class="input1">
					</h:inputText>
					<ui:define name="remark">affectu显示名</ui:define>
				</s:decorate>
				<s:decorate id="nameDecorate"
					template="../include/wike/validInputField.xhtml">
					<ui:define name="label">真实姓名</ui:define>
					<h:inputText value="#{profileAction.user.trueName}" class="input1">
					</h:inputText>
					<ui:define name="remark">予以保密</ui:define>
				</s:decorate>
				<s:decorate template="../include/wike/validInputField.xhtml">
					<ui:define name="label">性别</ui:define>
					<h:selectOneMenu value="#{profileAction.user.gender}">
						<f:selectItem itemValue="男" itemLabel="男" />
						<f:selectItem itemValue="女" itemLabel="女" />
					</h:selectOneMenu>
				</s:decorate>
				<s:decorate template="../include/wike/validInputField.xhtml">
					<ui:define name="label">出生年月</ui:define>
					<rich:calendar value="#{profileAction.user.birthday}"
						inputStyle="input1"></rich:calendar>
					<ui:define name="remark"></ui:define>
				</s:decorate>
				<s:decorate template="../include/wike/validInputField.xhtml">
					<ui:define name="label">所在地</ui:define>
					<h:inputText value="#{profileAction.user.address}" class="input1">
					</h:inputText>
				</s:decorate>
				<s:decorate template="../include/wike/validInputField.xhtml">
					<ui:define name="label">联系电话</ui:define>
					<h:inputText value="#{profileAction.user.telephone}" class="input1">
					</h:inputText>
				</s:decorate>
				<s:decorate template="../include/wike/validInputField.xhtml">
					<ui:define name="label">QQ/MSN</ui:define>
					<h:inputText value="#{profileAction.user.qq}" class="input1">
					</h:inputText>
				</s:decorate>
				<s:decorate template="../include/wike/validInputField.xhtml">
					<ui:define name="label">Email</ui:define>
					<h:inputText value="#{profileAction.user.email}" class="input1"
						required="true">
					</h:inputText>
				</s:decorate>
				<s:decorate id="specialtyDecorate"
					template="../include/wike/validInputField.xhtml">
					<ui:define name="label">专长</ui:define>
					<h:inputTextarea value="#{profileAction.user.specialty}"
						class="inputArea" rows="6">
						<a:support event="onclick"
							action="#{profileAction.showCategoryDiv()}" reRender="detailForm" />
					</h:inputTextarea>
					<ui:define name="remark">不妨从列表中选取</ui:define>
				</s:decorate>
				<s:div id="categoryDiv" rendered="false"
					binding="#{profileAction.categoryDiv}">
					<rich:dataGrid value="#{categoryAction.getCategoriesByLevel(1)}"
						var="category" columns="3" elements="9">
						<rich:panel style="width:200px">
							<f:facet name="header">
								<h:outputText value="#{category.name}"></h:outputText>
							</f:facet>
							<h:panelGrid columns="2">
								<a:repeat value="#{category.children}" var="child">
									<a:commandLink
										action="#{profileAction.addCategoryToSpecialty(child)}"
										value="#{child.name}," reRender="specialtyDecorate" />
								</a:repeat>
							</h:panelGrid>
						</rich:panel>
					</rich:dataGrid>
				</s:div>
				<s:decorate template="../include/wike/validInputField.xhtml">
					<ui:define name="label">个人站点</ui:define>
					<h:inputText value="#{profileAction.user.webSite}" class="input1">
					</h:inputText>
				</s:decorate>

				<br />
				<br />
				<rich:separator lineType="dotted" height="2px" />
				<br />
				<h:commandButton
					action="#{profileAction.submit(profileAction.user)}" value="提交"></h:commandButton>
			</h:form>
		</rich:panel>


	</ui:define>
</ui:composition>
